//
//  LoginRegisterIdentityCell.swift
//  GLUZSwift
//
//  Created by xyanl on 2025/3/7.
//  Copyright © 2025 考拉🐨. All rights reserved.
//

import UIKit
import Reusable

extension LoginRegisterIdentityCell: NibReusable {}

class LoginRegisterIdentityCell: UICollectionViewCell {
    
    @IBOutlet weak var titleLabel: UILabel!
    
    var model: IdentityModel? {
        didSet {
            guard let model = model else { return }
            titleLabel.text = model.name.localized(.login)
            
            if model.isSelected {
                contentView.backgroundColor = UIColor(hex: "#D7E9FF")
                contentView.addRoundedCorners(radius: 10, width: 1, color: UIColor(hex: "#278AFF"))
                titleLabel.textColor = UIColor(hex: "#278AFF")
                
            } else {
                contentView.backgroundColor = UIColor(hex: "#F7F7F7")
                contentView.addRoundedCorners(radius: 10, width: 1, color: UIColor(hex: "#F7F7F7"))
                titleLabel.textColor = UIColor(hex: "#0E0E0E")
                
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

}
